<template>
	<view>
		<view v-if="!loading">
			<uv-swiper :list="details.list" indicator indicatorMode="line" height="1000rpx" @click="previewImage"></uv-swiper>
			<view class="content">{{details.content}}</view>
		</view>
		<uv-loading-page :loading="loading" loading-mode="spinner"></uv-loading-page>
	</view>
</template>

<script>
	import {
		getIsCommentInfo
	} from '@/common/api.js'
	const app = getApp();
	export default {
		data() {
			return {
				loading: false,
				details: {
					list: [],
					content: ''
				},
			}
		},
		onLoad(e) {
			console.log(e);
			this.getData(e.id)
		},

		methods: {
			getData(id) {
				console.log(id);
				this.loading = true
				getIsCommentInfo({
					id
				}).then(res => {
					this.details.list = JSON.parse(res.data.commentUrl)
					this.details.content = res.data.commentContent
					this.loading = false
				}).catch(err => {
					this.loading = false
				})
			},
			previewImage(index) {
				uni.previewImage({
					current: this.list[index],
					showmenu: true,
					urls: this.list
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 40rpx;
		box-sizing: border-box;
		font-weight: 500;
		font-size: 28rpx;
		color: #000000;
		line-height: 60rpx;
	}
</style>